Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Feat/stream event for ai sdk - #15

Merged
Pederzh merged 6 commits into
mainfrom
feat/stream-event-for-ai-sdk
Jul 16, 2025
Merged

Feat/stream event for ai sdk#15
Pederzh merged 6 commits into
mainfrom
feat/stream-event-for-ai-sdk

Conversation

@Pederzh

@Pederzh Pederzh commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

Description

🔄 Streaming Methods

  • Added stream() method for step-by-step agent execution visibility
  • Added streamEvents() method for token-level streaming with fine-grained
    event tracking

🚀 AI SDK Integration

  • Added utilities for seamless integration with Vercel AI SDK (ai package)
  • New utility functions: streamEventsToAISDK(),
    streamEventsToAISDKWithTools(), and createReadableStreamFromGenerator()
  • Full compatibility with React hooks like useCompletion and useChat

📚 Enhanced Documentation

  • Comprehensive API documentation for all streaming methods
  • Detailed examples showing differences between run(), stream(), and
    streamEvents()
  • Complete AI SDK integration guide with Next.js examples

🧪 Examples & Tests

  • Added stream_example.ts demonstrating both streaming methods
  • Added stream_events_example.ts with comprehensive streamEvents usage

Technical Details:

The implementation provides three complementary methods:

  • run(): Simple execution with final result only
  • stream(): Step-by-step execution with intermediate tool usage
  • streamEvents(): Token-level streaming with full LangChain event tracking

The AI SDK integration enables developers to build streaming UIs that can
display:

  • Real-time token-by-token responses
  • Tool usage notifications
  • Progress indicators
  • Error handling

This makes the library suitable for production chat applications, debugging
tools, and any scenario requiring real-time agent execution visibility.

@Pederzh
Pederzh merged commit 7f7784b into main Jul 16, 2025
@Pederzh
Pederzh deleted the feat/stream-event-for-ai-sdk branch July 16, 2025 03:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant